package com.example.kuaizu.controller;

import com.example.kuaizu.pojo.SubMassageParam;
import com.example.kuaizu.service.InSubscribeMassageService;
import com.example.kuaizu.utils.AjaxResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: wangmx15
 * @date: 2025/8/24
 **/
@Log4j2
@RestController
@RequestMapping("/massage")
@RequiredArgsConstructor
public class SubscribeMassageController {
    private final InSubscribeMassageService inSubscribeMassageService;

    //订阅消息
    @PostMapping("/project/subscribe")
    public AjaxResponse subscribe(SubMassageParam req) {
        log.info("订阅消息");
        inSubscribeMassageService.subscribe(req);
        return AjaxResponse.success("添加订阅消息成功");
    }
}
